<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>函数的定义与调用</title>
</head>
<body>
    <script>
        function getMax(max){
            var sum=0;
            for (let i = 1; i <= max; i++) {
                sum+=i;
            }
            return sum;
        }
        document.write(getMax(100));
    </script>
</body>
</html>